import java.io.*;
import java.util.Enumeration;
import java.util.Vector;

public final class Cls_10 extends Cls_13
{

    public static int fld_74 = 0x80000000;
    public String fld_75;
    public int fld_76;
    public int fld_77;
    public String fld_78;
    public static Object fld_79 = new Object();
    public int fld_80;
    public byte fld_81[];

    public Cls_10(String s, String s1)
    {
        super(s + "/res/6.0.24093/" + s1);
        fld_77 = 1;
    }

    public Cls_10(String s, int i, int j)
    {
        super(s, i, j, null, true);
        fld_77 = -1;
    }

    public final void mth_73()
    {
        Cls_10 cls_10;
        if(fld_77 != 1)
        {
            if((cls_10 = this).fld_77 != -1)
            {
                cls_10.Cls_15.mth_73();
                return;
            } else
            {
                cls_10.Cls_15.mth_73();
                return;
            }
        } else
        {
            super.mth_73();
            return;
        }
    }

    public Cls_10(String as[], int i)
    {
        super("http://10.30.2.71/cgi-bin/extension.rb", i, "content-type:application/x-www-form-urlencoded");
        if(Cls_16.fld_353 == null)
            Cls_16.fld_353 = Cls_16.mth_131(Cls_16.mth_306("/a"));
        if(Cls_16.fld_355 == null)
            Cls_16.fld_355 = Cls_16.mth_131(new ByteArrayInputStream(Cls_16.mth_390()));
        super.fld_93 = "code=" + Cls_16.fld_353 + "&resource=" + Cls_16.fld_355 + "&&extensions=" + as[0];
        for(i = 1; i < as.length; i++)
            super.fld_93 = super.fld_93 + "," + as[i];

    }

    public static void mth_74(int i)
    {
        if(i <= fld_74)
            return;
        fld_74 = i;
        synchronized (fld_79){
            fld_79.notifyAll();
        }
    }

    private void mth_75()
    {
        super.mth_80();
        synchronized (fld_79){
            fld_79.notifyAll();
        }
    }

    private void mth_76(DataInputStream datainputstream)
    {
_L2:
        if(super.fld_96.mth_32())
            break MISSING_BLOCK_LABEL_34;
        Object obj = fld_79;
        JVM INSTR monitorenter ;
        fld_79.wait();
        break MISSING_BLOCK_LABEL_57;
        JVM INSTR pop ;
        return;
        int i;
        if((i = datainputstream.read()) < 0)
        {
            mth_78(504, "Server closed connection");
            return;
        }
        if(i != 0)
            continue; /* Loop/switch isn't completed */
        Cls_16.fld_301.mth_473();
        if(super.fld_89)
        {
            Cls_16.fld_301.mth_474();
            return;
        }
        Cls_16.fld_279.mth_745(0);
        mth_97(11);
        if(true) goto _L2; else goto _L1
_L1:
    }

    public final void mth_77(DataInputStream datainputstream)
    {
        Cls_10 cls_10;
        int i;
        int k;
        Cls_20 cls_20;
        if(fld_77 == 1)
            break MISSING_BLOCK_LABEL_257;
        if((cls_10 = this).fld_77 == -1)
            break MISSING_BLOCK_LABEL_251;
        i = datainputstream.readInt();
        k = 4;
        if(i <= 0)
            break MISSING_BLOCK_LABEL_122;
        cls_20 = Cls_20.mth_835(10, "code.patch");
_L6:
        if(i-- <= 0) goto _L2; else goto _L1
_L1:
        cls_20.write(datainputstream.read());
        if(i % 10240 != 0)
            continue; /* Loop/switch isn't completed */
        Cls_16.fld_301.mth_473();
        if(cls_10.fld_76 <= 0) goto _L4; else goto _L3
_L3:
        Cls_16.fld_279;
        Math.min((k * 100) / cls_10.fld_76, 99);
          goto _L5
_L4:
        Cls_16.fld_279;
        false;
_L5:
        mth_758();
        cls_10.mth_94();
        k++;
          goto _L6
_L2:
        cls_20.close();
        break MISSING_BLOCK_LABEL_129;
        if(i == 0)
            Cls_16.mth_487();
        int j;
        if((j = datainputstream.readInt()) > 0)
        {
            Cls_20 cls_20_1 = Cls_20.mth_835(10, "resource.patch");
            while(j-- > 0) 
            {
                cls_20_1.write(datainputstream.read());
                if(j % 10240 == 0)
                {
                    Cls_16.fld_301.mth_473();
                    Cls_16.fld_279.mth_758(Math.min((k * 100) / cls_10.fld_76, 99));
                    cls_10.mth_94();
                }
                k++;
            }
            cls_20_1.close();
        } else
        if(j == 0)
            Cls_16.mth_493();
        Cls_16.fld_301.mth_473();
        Cls_16.fld_279.mth_758(100);
        Cls_16.fld_301.mth_458(Cls_16.mth_483(((Cls_15) (cls_10)).fld_88));
        return;
        cls_10.mth_76(datainputstream);
        return;
        Cls_10 cls_10_1;
        if((cls_10_1 = this).fld_76 > 0)
        {
            byte abyte0[] = new byte[1024];
            ByteArrayOutputStream bytearrayoutputstream = new ByteArrayOutputStream(cls_10_1.fld_76);
            int l;
            for(; cls_10_1.fld_80 < cls_10_1.fld_76 && (l = datainputstream.read(abyte0)) >= 0; cls_10_1.fld_80 += l)
                bytearrayoutputstream.write(abyte0, 0, l);

            bytearrayoutputstream.close();
            cls_10_1.fld_81 = bytearrayoutputstream.toByteArray();
            return;
        }
        if(cls_10_1.fld_78 == null)
            cls_10_1.mth_78(0, "Invalid content length");
        return;
    }

    public final void mth_78(int i, String s)
    {
        if(fld_77 != 1)
        {
            i = s;
            s = this;
            if(fld_77 != -1)
            {
                i = s;
                Cls_16.fld_301.mth_473();
                Cls_16.fld_279.mth_758(-1);
                Cls_16.fld_301.mth_458(Cls_16.mth_483(((Cls_15) (i)).fld_88));
                return;
            }
            Cls_16.fld_301.mth_473();
            if(((Cls_15) (s)).fld_89)
            {
                Cls_16.fld_301.mth_474();
                return;
            } else
            {
                Cls_16.fld_279.mth_745(Cls_16.fld_279.mth_140(((String) (i == null ? "Unspecified error" : ((String) (i))))));
                s.mth_97(10);
                return;
            }
        } else
        {
            i = s;
            s = this;
            fld_78 = i;
            s.fld_76 = -1;
            return;
        }
    }

    public final void mth_79(int i, String s, Vector vector)
    {
        if(fld_77 != 1)
        {
            i = vector;
            s = s;
            vector = i;
            Cls_10 cls_10 = this;
            if(fld_77 != -1)
            {
                if(vector != 200)
                {
                    cls_10.mth_78(vector, s);
                    return;
                }
                i = i.elements();
                do
                {
                    if(!i.hasMoreElements())
                        break;
                    s = ((String)i.nextElement()).toLowerCase();
                    vector = ((String)i.nextElement()).toLowerCase();
                    if(s.equals("content-length"))
                        cls_10.fld_76 = Integer.parseInt(vector);
                } while(true);
            } else
            {
                i = s;
                s = vector;
                vector = cls_10;
                if(s != 200)
                {
                    vector.mth_78(s, i);
                    return;
                }
                Cls_16.fld_301.mth_473();
                if(((Cls_15) (vector)).fld_89)
                {
                    Cls_16.fld_301.mth_474();
                    return;
                }
                vector.mth_97(9);
            }
            return;
        }
        i = vector;
        s = s;
        vector = i;
        Cls_10 cls_10_1 = this;
        if(vector != 200)
        {
            cls_10_1.mth_78(vector, s);
            return;
        }
        i = i.elements();
        do
        {
            if(!i.hasMoreElements())
                break;
            s = ((String)i.nextElement()).toLowerCase();
            vector = ((String)i.nextElement()).toLowerCase();
            if(s.equals("content-length"))
                cls_10_1.fld_76 = Integer.parseInt(vector);
            else
            if(s.equals("update-digest"))
                cls_10_1.fld_75 = vector;
        } while(true);
    }

    public final void mth_80()
    {
        Cls_10 cls_10;
        if(fld_77 != 1)
        {
            if((cls_10 = this).fld_77 != -1)
            {
                cls_10.Cls_15.mth_80();
                return;
            } else
            {
                cls_10.mth_75();
                return;
            }
        } else
        {
            super.mth_80();
            return;
        }
    }

}